package com.heima.controller.user_service;


import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.heima.mapper.RoleMapper;
import com.heima.pojo.entity.Role;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Slf4j
@RestController
@RequestMapping("/api/user-service/role")
public class RoleController {
    @Autowired
    private RoleMapper roleMapper;

    /**
     * 查询角色列表
     * @return
     */
    @GetMapping
    public List<Role> getRoleList(){
        List<Role> roles = roleMapper.selectList(new LambdaQueryWrapper<>());
        return roles;
    }
}
